#define _CRT_SECURE_NO_WARNINGS 1
#include"Head.h"
struct Com
{
    bool operator()(const pair<string, int>& l, const pair<string, int>& r)
    {
        return l.second > r.second;
    }
};
class Solution {
public:
    vector<string> topKFrequent(vector<string>& words, int k) {
        map<string, int> fre;
        for (auto& e : words)
        {
            fre[e]++;
        }
        priority_queue<pair<string, int>, vector<pair<string, int>>, Com()> pq(fre.begin(), fre.end());
        vector<string> ans;
        while (k--)
        {
            ans.push_back(pq.top().first);
            pq.pop();
        }
        return ans;
    }
};

int main()
{
    Solution s;
    s.topKFrequent
}